import React, { Component } from "react";
import { Link } from "react-router-dom";
// import { actions as detailAction } from "../../../../redux/modules/detail"
import "./style.css";

class Discount extends Component {
  render() {
    const { data } = this.props;
    return (
      <div className="discount">
        <a className="discount__header">
          <span className="discount__title">超值特惠</span>
          <span className="discount__more">更多优惠</span>
          <span className="discount__arrow" />
        </a>
        <div className="discount__content">
          {data.map((item, index) => {
            return (
              <Link
                key={index}
                to={`/detail/${item.id}`}
                className="discount__item"
                data={item}
              >
                <div className="discountItem__picContainer">
                  <div className="discountItem__picTag">{item.tag}</div>
                  <img alt="" className="discountItem__pic" src={item.picture} />
                </div>
                <div className="discountItem__content">
                  <div className="discountItem__shop">{item.shop}</div>
                  <div className="discountItem__product">{item.product}</div>
                  <div className="discountItem__detail">
                    <div className="discountItem__price">
                      <ins className="discountItem__currentPrice">{item.currentprice}</ins>
                      <del className="discountItem__oldPrice">{item.oldprice}</del>
                    </div>
                  </div>
                </div>
              </Link>
            );
          })}
        </div>
      </div>
    );
  }
}

export default Discount;

